﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>hhh</title>
    <link href="../../Content/EasyUI/themes/default/easyui.css" rel="stylesheet" />
    <link href="../../Content/EasyUI/themes/icon.css" rel="stylesheet" />
    <link href="~/Content/EasyUI/themes/metro/admin.css" rel="stylesheet" />
    <script src="../../Content/EasyUI/jquery.min.js"></script>
    <script src="../../Content/EasyUI/jquery.easyui.min.js"></script>
</head>
<body class="easyui-layout" data-options="fit:true,scroll:'no'">
    <div data-options="region:'north',border:false" style="height: 74px; background: #2596ea; padding: 10px">
        <img src="../../Content/images/logo.png" />EasyUIDemo
    </div>
    <div data-options="region:'west',split:true,title:'导航菜单'" style="width: 170px;">
        <div class="easyui-accordion" data-options="fit:true,border:false">
            
                
            
        </div>
    </div>
    <div data-options="region:'south',border:false" style="height: 23px;">
        <div class="footer">EasyUIDemo</div>
    </div>
    <div data-options="region:'center'">
        <div id="tabs" class="easyui-tabs" data-options="tools:'#tab-tools',fit:true,border:false">
            <div title="主页" data-options="iconCls:'icon-house'" style="padding: 10px;">
                <iframe scrolling="auto" frameborder="0" src="@Url.Content("https://www.baidu.com/")" style="width:100%;height:100%;"></iframe>
            </div>
        </div>
        <div id="tab-tools">
            <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'" onclick="addTab('主页', 'https://www.baidu.com/', 'icon-house')"></a>
            <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-remove'" onclick="removeTab()"></a>
        </div>
    </div>
    <div id="mm" class="easyui-menu" style="width: 150px;">
        <div id="refresh" data-options="iconCls:'icon-arrow_refresh'">刷新</div>
        <div class="menu-sep"></div>
        <div id="close">关闭</div>
        <div id="closeall">全部关闭</div>
        <div id="closeother">除此之外全部关闭</div>
        <div class="menu-sep"></div>
        <div id="closeright">当前页右侧全部关闭</div>
        <div id="closeleft">当前页左侧全部关闭</div>
        <div class="menu-sep"></div>
        <div id="exit">退出</div>
    </div>
</body>
</html>
<script>//onclick='addTab(" + item.authority_Name + ", " + item.authority_Url + ", '')'
    //此处是把后台传过来的json数据转成easyui规定的格式  "<a href='" + item.authority_Url + "'> " + item.authority_Name + "</a>"
    function bl(item) {
        var tree = new Object();
        tree.id = item.parentId;
        tree.text = "<a onclick='addTab(\""+item.authority_Name+"\",\""+item.authority_Url+"\",\"\")'> " + item.authority_Name + " </a>";
        tree.state = 'open';
        tree.checked = 'false';
        tree.attributes = item.authority_Url;
        if (item.child_menus.length != 0) {
            tree.children = jsonbl(item.child_menus);
        } else {
            tree.children = [];
        }
        return tree;
    }
    function jsonbl(data) {
        var easyTree = [];
        $.each(data, function (index, item) {
            easyTree[index] = bl(item);
        });
        return easyTree;
    }
    //此处是easyui调用tree组件的方法(使用easyui的童鞋自然懂得，只需修改请求json的api即可)  
    $('#tt').tree({
        url: 'http://localhost:63805/apis/Authoritys/getlist',
        
        loadFilter: function (data) {
            return jsonbl(data);
        }
    });
</script>


<script src="~/Content/EasyUI/js/common.js"></script>